package com.silp.baitap1;

import java.util.Random;

public class Ham_kieu2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
//		int a=random();
//		int b=random();
		int a=2;
		int b=3;
		
		System.out.println("Ket qua cong cua 2 so "+a+" va "+b+" la "+add (a, b));
		System.out.println("Ket qua tru cua 2 so "+a+" va "+b+" la "+sub (a, b));
		System.out.println("Ket qua nhan cua 2 so "+a+" va "+b+" la "+mul (a, b));
		System.out.println("Ket qua chia cua 2 so "+a+" va "+b+" la "+div (a, b));
		
	}

	private static int mul(int a, int b) {
		int c = a*b;
		return c;
	}

	private static int div(int a, int b) {
		int c = 0;
		if((a==0)||(b==0)){
			System.out.println("Sai dieu kien");
		}
		else {
		c = a%b;
		}
		
		return c;
		
	}

	private static int sub(int a, int b) {
		int c = 0;
		if((a<b)||(sub(a, b)==0)){
			System.out.println("Sai dieu kien");
		}
		else {
		c = a-b;
		}
		
		return c;
	}

	private static int add(int a, int b) {
		int c = a+b;
		return c;
	}

	private static int random() {
		Random r=new Random();
		int j = r.nextInt(100);
		return j;
	}
	
}
